package ch.quantasy.android.speech.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import ch.quantasy.android.speech.SpeechService;
import ch.quantasy.android.speech.string.FrenchString;
import ch.quantasy.android.speech.string.GermanString;
import ch.quantasy.android.speech.string.ItalianString;
import ch.quantasy.android.speech.string.SpanishString;
import ch.quantasy.android.speech.string.UKString;
import ch.quantasy.android.speech.string.USString;

public class Babel extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_babel);
		Intent speechIntent = SpeechService.getSpeechIntent();

		SpeechService.setPhrase(speechIntent, new USString(
				"This is an implicit service request."));
		startService(speechIntent);

		SpeechService.setPhrase(speechIntent, new UKString(
				"This is an implicit service request."), new GermanString(
				"Dies ist ein impliziter Aufruf eines Service."),
				new FrenchString("C'est un appele implicite au service."));
		startService(speechIntent);

		SpeechService
				.setPhrase(speechIntent, new ItalianString(
						"Questo è un implicito richiamo al servizio."),
						new SpanishString(
								"Esta es una llamada implícita al servicio."));
		startService(speechIntent);

	}

	@Override
	protected void onDestroy() {
		Intent speechIntent = new Intent(
				"ch.quantasy.android.speech.SPEECH_SERVICE");
		stopService(speechIntent);
		super.onDestroy();
	}
}